src: improve attributes
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Thu, 13 Nov 2025 10:28:12 +0000 (11:28 +0100)
committerÁlvaro Fernández Rojas <noltari@gmail.com>
Mon, 17 Nov 2025 07:24:50 +0000 (08:24 +0100)
- Properly guard odhcp6c.h attributes with `#ifndef` to avoid redefining
them when including external headers.
- Also convert the remaining __attribute__ usages to the custom
declarations.
- Consolidate custom declarations with _o_ prefix.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Link: https://github.com/openwrt/odhcpd/pull/307
14 files changed:
src/config.c
src/dhcpv4.c
src/dhcpv4.h
src/dhcpv6-ia.c
src/dhcpv6-pxe.c
src/dhcpv6.c
src/dhcpv6.h
src/ndp.c
src/netlink.c
src/odhcpd.c
src/odhcpd.h
src/router.c
src/statefiles.c
src/ubus.c

index 27ab531c775a7333deed26aea7e87910fcf947de..9246d64f23769beb91007537543147a04ba19287 100644 (file)
@@ -1016,7 +1016,7 @@ static int parse_dnr_str(char *str, struct interface *iface)
                                error("Invalid value '%s' for SvcParam 'port'", svc_val_str);
                                goto err;
                        }
-                       _fallthrough;
+                       _o_fallthrough;
 
                case DNR_SVC_DOHPATH:
                        /* plain string */
@@ -1065,7 +1065,7 @@ err:
        return -1;
 }
 
-static int avl_ipv4_cmp(const void *k1, const void *k2, _unused void *ptr)
+static int avl_ipv4_cmp(const void *k1, const void *k2, _o_unused void *ptr)
 {
        return memcmp(k1, k2, sizeof(struct in_addr));
 }
@@ -1733,7 +1733,7 @@ static void lease_cfg_update_leases(struct lease_cfg *lease_cfg)
        }
 }
 
-static int lease_cfg_cmp(const void *k1, const void *k2, _unused void *ptr)
+static int lease_cfg_cmp(const void *k1, const void *k2, _o_unused void *ptr)
 {
        const struct lease_cfg *lease_cfg1 = k1, *lease_cfg2 = k2;
        int cmp = 0;
@@ -1810,7 +1810,7 @@ static void lease_cfg_delete(struct lease_cfg *lease_cfg)
        free_lease_cfg(lease_cfg);
 }
 
-static void lease_cfg_update(_unused struct vlist_tree *tree, struct vlist_node *node_new,
+static void lease_cfg_update(_o_unused struct vlist_tree *tree, struct vlist_node *node_new,
                            struct vlist_node *node_old)
 {
        struct lease_cfg *lease_cfg_new = container_of(node_new, struct lease_cfg, node);
@@ -2443,7 +2443,7 @@ static void handle_signal(int signal)
                uloop_end();
 }
 
-static void reload_cb(struct uloop_fd *u, _unused unsigned int events)
+static void reload_cb(struct uloop_fd *u, _o_unused unsigned int events)
 {
        char b[512];
        if (read(u->fd, b, sizeof(b)) < 0) {}
index 22291979422530e47c783dd19a13c20c06f8f4d2..ba8255965c7e4a1d25367054a8de194dd4a5496e 100644 (file)
@@ -774,7 +774,7 @@ enum {
 };
 
 void dhcpv4_handle_msg(void *src_addr, void *data, size_t len,
-               struct interface *iface, _unused void *our_dest_addr,
+               struct interface *iface, _o_unused void *our_dest_addr,
                send_reply_cb_t send_reply, void *opaque)
 {
        /* Request variables */
@@ -1319,7 +1319,7 @@ void dhcpv4_handle_msg(void *src_addr, void *data, size_t len,
 
 /* Handler for DHCPv4 messages */
 static void dhcpv4_handle_dgram(void *addr, void *data, size_t len,
-                               struct interface *iface, _unused void *dest_addr)
+                               struct interface *iface, _o_unused void *dest_addr)
 {
        int sock = iface->dhcpv4_event.uloop.fd;
 
index c120f7f6a92deb0722e7b763d6ca66de725cd43f..d2b31a3280046339638837e98723e3bba3f34745 100644 (file)
@@ -101,7 +101,7 @@ struct dhcpv4_message {
        char file[128];
        uint32_t cookie;
        uint8_t options[];
-} _packed;
+} _o_packed;
 
 // RFC2131, §3
 #define DHCPV4_MAGIC_COOKIE 0x63825363
@@ -114,7 +114,7 @@ struct dhcpv4_auth_forcerenew {
        uint32_t replay[2];
        uint8_t type;
        uint8_t key[16];
-} _packed;
+} _o_packed;
 
 // https://www.iana.org/assignments/auth-namespaces/auth-namespaces.xhtml#auth-namespaces-1
 enum dhcpv4_auth_protocol {
@@ -164,7 +164,7 @@ struct dhcpv4_option_u32 {
        uint8_t code;
        uint8_t len;
        uint32_t data;
-} _packed;
+} _o_packed;
 
 /* DNR */
 struct dhcpv4_dnr {
index 4b11b5716c762637e64a2ee420e647195ae26084..dd46a14ae279e5d5cd343fa6a1b0bb7a84207174 100644 (file)
@@ -166,7 +166,7 @@ static int send_reconf(struct dhcpv6_lease *assign)
                uint16_t code;
                uint16_t len;
                uint8_t data[DUID_MAX_LEN];
-       } _packed serverid = {
+       } _o_packed serverid = {
                .code = htons(DHCPV6_OPT_SERVERID),
                .len = 0,
                .data = { 0 },
@@ -175,7 +175,7 @@ static int send_reconf(struct dhcpv6_lease *assign)
                uint16_t code;
                uint16_t len;
                uint8_t data[DUID_MAX_LEN];
-       } _packed clientid = {
+       } _o_packed clientid = {
                .code = htons(DHCPV6_OPT_CLIENTID),
                .len = htons(assign->duid_len),
                .data = { 0 },
@@ -184,7 +184,7 @@ static int send_reconf(struct dhcpv6_lease *assign)
                uint16_t code;
                uint16_t len;
                uint8_t id;
-       } _packed message = {
+       } _o_packed message = {
                .code = htons(DHCPV6_OPT_RECONF_MSG),
                .len = htons(1),
                .id = DHCPV6_MSG_RENEW,
@@ -574,7 +574,7 @@ static size_t build_ia(uint8_t *buf, size_t buflen, uint16_t status,
                return 0;
 
        if (status) {
-               struct __attribute__((packed)) {
+               struct _o_packed {
                        uint16_t type;
                        uint16_t len;
                        uint16_t val;
@@ -820,8 +820,8 @@ struct log_ctxt {
        int buf_idx;
 };
 
-static void dhcpv6_log_ia_addr(_unused struct dhcpv6_lease *lease, struct in6_addr *addr, int prefix,
-                              _unused uint32_t pref_lt, _unused uint32_t valid_lt, void *arg)
+static void dhcpv6_log_ia_addr(_o_unused struct dhcpv6_lease *lease, struct in6_addr *addr, int prefix,
+                              _o_unused uint32_t pref_lt, _o_unused uint32_t valid_lt, void *arg)
 {
        struct log_ctxt *ctxt = (struct log_ctxt *)arg;
        char addrbuf[INET6_ADDRSTRLEN];
index 10f82dc37aa651d5e00624bee17e3bac190e5b13..58d84665e920b3f2db75e3201c4c353fb8f0446b 100644 (file)
@@ -11,7 +11,7 @@ struct ipv6_pxe_entry {
        uint32_t arch;
 
        // Ready to send
-       struct __attribute__((packed)) {
+       struct _o_packed {
                uint16_t type;          // In network endianess
                uint16_t len;           // In network endianess, without /0
                char payload[];         // Null-terminated here
index 223c8a3fa0cfb97384bc876abdea4dc5d307b199..a808400e7fae4538339649248e82b452b81297a6 100644 (file)
@@ -257,8 +257,8 @@ struct dhcpv4_msg_data {
 };
 
 static ssize_t dhcpv6_4o6_send_reply(struct iovec *iov, size_t iov_len,
-                                    _unused struct sockaddr *dest,
-                                    _unused socklen_t dest_len,
+                                    _o_unused struct sockaddr *dest,
+                                    _o_unused socklen_t dest_len,
                                     void *opaque)
 {
        struct dhcpv4_msg_data *reply = opaque;
@@ -363,7 +363,7 @@ static void handle_client_request(void *addr, void *data, size_t len,
        debug("Got a DHCPv6-request on %s", iface->name);
 
        /* Construct reply message */
-       struct _packed {
+       struct _o_packed {
                uint8_t msg_type;
                uint8_t tr_id[3];
                uint16_t serverid_type;
@@ -386,7 +386,7 @@ static void handle_client_request(void *addr, void *data, size_t len,
                dest.serverid_length = htons(sizeof(duid_ll_hdr) + ETH_ALEN);
        }
 
-       struct _packed {
+       struct _o_packed {
                uint16_t type;
                uint16_t len;
                uint8_t buf[DUID_MAX_LEN];
@@ -396,26 +396,26 @@ static void handle_client_request(void *addr, void *data, size_t len,
                .buf = { 0 },
        };
 
-       struct __attribute__((packed)) {
+       struct _o_packed {
                uint16_t type;
                uint16_t len;
                uint32_t value;
        } maxrt = {htons(DHCPV6_OPT_SOL_MAX_RT), htons(sizeof(maxrt) - 4),
                        htonl(60)};
 
-       struct __attribute__((packed)) {
+       struct _o_packed {
                uint16_t type;
                uint16_t len;
        } rapid_commit = {htons(DHCPV6_OPT_RAPID_COMMIT), 0};
 
-       struct __attribute__((packed)) {
+       struct _o_packed {
                uint16_t type;
                uint16_t len;
                uint16_t value;
        } stat = {htons(DHCPV6_OPT_STATUS), htons(sizeof(stat) - 4),
                        htons(DHCPV6_STATUS_USEMULTICAST)};
 
-       struct __attribute__((packed)) {
+       struct _o_packed {
                uint16_t type;
                uint16_t len;
                uint32_t value;
@@ -614,7 +614,7 @@ static void handle_client_request(void *addr, void *data, size_t len,
        } search = {htons(DHCPV6_OPT_DNS_DOMAIN), htons(search_len)};
 
 
-       struct __attribute__((packed)) dhcpv4o6_server {
+       struct _o_packed dhcpv4o6_server {
                uint16_t type;
                uint16_t len;
                struct in6_addr addr;
@@ -733,7 +733,7 @@ static void handle_client_request(void *addr, void *data, size_t len,
 
 #ifdef DHCPV4_SUPPORT
        if (hdr->msg_type == DHCPV6_MSG_DHCPV4_QUERY) {
-               struct _packed dhcpv4_msg_data {
+               struct _o_packed dhcpv4_msg_data {
                        uint16_t type;
                        uint16_t len;
                        uint8_t msg[1];
index af175c9549bd6df4828b6e06d525c468fe5f3c8b..7aed782f08e71254ee83f07ea40e8a24c09d5254 100644 (file)
@@ -98,7 +98,7 @@
 struct dhcpv6_client_header {
        uint8_t msg_type;
        uint8_t transaction_id[3];
-} __attribute__((packed));
+} _o_packed;
 
 struct dhcpv6_relay_header {
        uint8_t msg_type;
@@ -106,7 +106,7 @@ struct dhcpv6_relay_header {
        struct in6_addr link_address;
        struct in6_addr peer_address;
        uint8_t options[];
-} __attribute__((packed));
+} _o_packed;
 
 struct dhcpv6_relay_forward_envelope {
        uint8_t msg_type;
@@ -118,7 +118,7 @@ struct dhcpv6_relay_forward_envelope {
        uint32_t interface_id_data;
        uint16_t relay_message_type;
        uint16_t relay_message_len;
-} __attribute__((packed));
+} _o_packed;
 
 struct dhcpv6_auth_reconfigure {
        uint16_t type;
@@ -129,7 +129,7 @@ struct dhcpv6_auth_reconfigure {
        uint32_t replay[2];
        uint8_t reconf_type;
        uint8_t key[16];
-} _packed;
+} _o_packed;
 
 struct dhcpv6_ia_hdr {
        uint16_t type;
@@ -137,7 +137,7 @@ struct dhcpv6_ia_hdr {
        uint32_t iaid;
        uint32_t t1;
        uint32_t t2;
-} _packed;
+} _o_packed;
 
 struct dhcpv6_ia_prefix {
        uint16_t type;
@@ -146,7 +146,7 @@ struct dhcpv6_ia_prefix {
        uint32_t valid_lt;
        uint8_t prefix;
        struct in6_addr addr;
-} _packed;
+} _o_packed;
 
 struct dhcpv6_ia_addr {
        uint16_t type;
@@ -154,7 +154,7 @@ struct dhcpv6_ia_addr {
        struct in6_addr addr;
        uint32_t preferred_lt;
        uint32_t valid_lt;
-} _packed;
+} _o_packed;
 
 struct dhcpv6_cer_id {
        uint16_t type;
index 6924602bdfc462c97241f551d4a0a6f1c206a656..d8bc24871d36a456a1e1fc74111e8bc5a9ca7b73 100644 (file)
--- a/src/ndp.c
+++ b/src/ndp.c
@@ -244,13 +244,13 @@ static void ndp_netevent_cb(unsigned long event, struct netevent_handler_info *i
        case NETEV_ADDR6_DEL:
                add = false;
                netlink_dump_neigh_table(false);
-               _fallthrough;
+               _o_fallthrough;
        case NETEV_ADDR6_ADD:
                setup_addr_for_relaying(&info->addr.in6, iface, add);
                break;
        case NETEV_NEIGH6_DEL:
                add = false;
-               _fallthrough;
+               _o_fallthrough;
        case NETEV_NEIGH6_ADD:
                if (info->neigh.flags & NTF_PROXY) {
                        if (add) {
@@ -328,7 +328,7 @@ static void send_na(struct in6_addr *to_addr,
 
 /* Handle solicitations */
 static void handle_solicit(void *addr, void *data, size_t len,
-               struct interface *iface, _unused void *dest)
+               struct interface *iface, _o_unused void *dest)
 {
        struct ip6_hdr *ip6 = data;
        struct nd_neighbor_solicit *req = (struct nd_neighbor_solicit*)&ip6[1];
index 9ef1a2824554e02a9ad22f38b2510de5f2c314de..48e27d0d62266d95cb673c657e35b0fcdf453d13 100644 (file)
@@ -439,7 +439,7 @@ static int handle_rtm_neigh(struct nlmsghdr *hdr, bool add)
 
 /* Handler for neighbor cache entries from the kernel. This is our source
  * to learn and unlearn hosts on interfaces. */
-static int cb_rtnl_valid(struct nl_msg *msg, _unused void *arg)
+static int cb_rtnl_valid(struct nl_msg *msg, _o_unused void *arg)
 {
        struct nlmsghdr *hdr = nlmsg_hdr(msg);
        int ret = NL_SKIP;
@@ -452,21 +452,21 @@ static int cb_rtnl_valid(struct nl_msg *msg, _unused void *arg)
 
        case RTM_NEWROUTE:
                add = true;
-               _fallthrough;
+               _o_fallthrough;
        case RTM_DELROUTE:
                ret = handle_rtm_route(hdr, add);
                break;
 
        case RTM_NEWADDR:
                add = true;
-               _fallthrough;
+               _o_fallthrough;
        case RTM_DELADDR:
                ret = handle_rtm_addr(hdr, add);
                break;
 
        case RTM_NEWNEIGH:
                add = true;
-               _fallthrough;
+               _o_fallthrough;
        case RTM_DELNEIGH:
                ret = handle_rtm_neigh(hdr, add);
                break;
@@ -599,7 +599,7 @@ static int cb_addr_valid(struct nl_msg *msg, void *arg)
 }
 
 
-static int cb_addr_finish(_unused struct nl_msg *msg, void *arg)
+static int cb_addr_finish(_o_unused struct nl_msg *msg, void *arg)
 {
        struct addr_info *ctxt = (struct addr_info *)arg;
 
@@ -609,7 +609,7 @@ static int cb_addr_finish(_unused struct nl_msg *msg, void *arg)
 }
 
 
-static int cb_addr_error(_unused struct sockaddr_nl *nla, struct nlmsgerr *err,
+static int cb_addr_error(_o_unused struct sockaddr_nl *nla, struct nlmsgerr *err,
                void *arg)
 {
        struct addr_info *ctxt = (struct addr_info *)arg;
@@ -770,7 +770,7 @@ static int cb_linklocal_valid(struct nl_msg *msg, void *arg)
 }
 
 
-static int cb_linklocal_finish(_unused struct nl_msg *msg, void *arg)
+static int cb_linklocal_finish(_o_unused struct nl_msg *msg, void *arg)
 {
        struct addr_info *ctxt = (struct addr_info *)arg;
 
@@ -780,7 +780,7 @@ static int cb_linklocal_finish(_unused struct nl_msg *msg, void *arg)
 }
 
 
-static int cb_linklocal_error(_unused struct sockaddr_nl *nla, struct nlmsgerr *err,
+static int cb_linklocal_error(_o_unused struct sockaddr_nl *nla, struct nlmsgerr *err,
                void *arg)
 {
        struct addr_info *ctxt = (struct addr_info *)arg;
@@ -886,7 +886,7 @@ static int cb_proxy_neigh_valid(struct nl_msg *msg, void *arg)
 }
 
 
-static int cb_proxy_neigh_finish(_unused struct nl_msg *msg, void *arg)
+static int cb_proxy_neigh_finish(_o_unused struct nl_msg *msg, void *arg)
 {
        struct neigh_info *ctxt = (struct neigh_info *)arg;
 
@@ -896,7 +896,7 @@ static int cb_proxy_neigh_finish(_unused struct nl_msg *msg, void *arg)
 }
 
 
-static int cb_proxy_neigh_error(_unused struct sockaddr_nl *nla, struct nlmsgerr *err,
+static int cb_proxy_neigh_error(_o_unused struct sockaddr_nl *nla, struct nlmsgerr *err,
                void *arg)
 {
        struct neigh_info *ctxt = (struct neigh_info *)arg;
index d41e4cd651b97574953e86fcc1b9304dac121492..1f2417b909f95060faf02a02bcbe6b670f3543a2 100644 (file)
@@ -67,7 +67,7 @@ void __iflog(int lvl, const char *fmt, ...)
        va_end(ap);
 }
 
-static void sighandler(_unused int signal)
+static void sighandler(_o_unused int signal)
 {
        uloop_end();
 }
@@ -420,7 +420,7 @@ struct interface* odhcpd_get_interface_by_index(int ifindex)
 }
 
 /* Convenience function to receive and do basic validation of packets */
-static void odhcpd_receive_packets(struct uloop_fd *u, _unused unsigned int events)
+static void odhcpd_receive_packets(struct uloop_fd *u, _o_unused unsigned int events)
 {
        struct odhcpd_event *e = container_of(u, struct odhcpd_event, uloop);
 
index 5daf5100f1cc55ea361e590ee4bf114899bfa706..eadb0fc53c342cc73a3cd7821e659c7d38d9897e 100644 (file)
@@ -21,6 +21,7 @@
 #include <stdbool.h>
 #include <syslog.h>
 
+#include <libubox/avl.h>
 #include <libubox/blobmsg.h>
 #include <libubox/list.h>
 #include <libubox/uloop.h>
 
 #define INFINITE_VALID(x) ((x) == 0)
 
-#define _unused __attribute__((unused))
-#define _packed __attribute__((packed))
-#define _fallthrough __attribute__((__fallthrough__))
+#ifndef _o_fallthrough
+#define _o_fallthrough __attribute__((__fallthrough__))
+#endif /* _o_fallthrough */
+
+#ifndef _o_packed
+#define _o_packed __attribute__((packed))
+#endif /* _o_packed */
+
+#ifndef _o_unused
+#define _o_unused __attribute__((unused))
+#endif /* _o_unused */
 
 #define ALL_IPV6_NODES "ff02::1"
 #define ALL_IPV6_ROUTERS "ff02::2"
@@ -616,7 +625,7 @@ int dhcpv4_init(void);
 void dhcpv4_free_lease(struct dhcpv4_lease *a);
 int dhcpv4_setup_interface(struct interface *iface, bool enable);
 void dhcpv4_handle_msg(void *addr, void *data, size_t len,
-                      struct interface *iface, _unused void *dest_addr,
+                      struct interface *iface, _o_unused void *dest_addr,
                       send_reply_cb_t send_reply, void *opaque);
 #else
 static inline void dhcpv4_free_lease(struct dhcpv4_lease *lease) {
index 621a0cdb1597e2c82931c3fa53021e5f0e9a1b39..c71ad9824253344f7990b28152a3083643c1a08e 100644 (file)
@@ -1052,7 +1052,7 @@ static void trigger_router_advert(struct uloop_timeout *event)
 
 /* Event handler for incoming ICMPv6 packets */
 static void handle_icmpv6(void *addr, void *data, size_t len,
-               struct interface *iface, _unused void *dest)
+               struct interface *iface, _o_unused void *dest)
 {
        struct icmp6_hdr *hdr = data;
        struct sockaddr_in6 *from = addr;
index 65920d25be8e9c355bd7234d3795a61c012f3ccf..ed45f5559dc061b33bfd35073d0ab79833d51a81 100644 (file)
@@ -68,8 +68,8 @@ static bool statefiles_write_host6(struct write_ctxt *ctxt, struct dhcpv6_lease
        return true;
 }
 
-static void statefiles_write_host6_cb(struct dhcpv6_lease *lease, struct in6_addr *addr, _unused int prefix,
-                                     _unused uint32_t pref_lt, _unused uint32_t valid_lt, void *arg)
+static void statefiles_write_host6_cb(struct dhcpv6_lease *lease, struct in6_addr *addr, _o_unused int prefix,
+                                     _o_unused uint32_t pref_lt, _o_unused uint32_t valid_lt, void *arg)
 {
        struct write_ctxt *ctxt = (struct write_ctxt *)arg;
 
@@ -162,7 +162,7 @@ err:
 }
 
 static void statefiles_write_state6_addr(struct dhcpv6_lease *lease, struct in6_addr *addr, int prefix,
-                                        _unused uint32_t pref_lt, _unused uint32_t valid_lt, void *arg)
+                                        _o_unused uint32_t pref_lt, _o_unused uint32_t valid_lt, void *arg)
 {
        struct write_ctxt *ctxt = (struct write_ctxt *)arg;
        char ipbuf[INET6_ADDRSTRLEN];
index bc8e456dadd2d9895610cf3df7226011932f1e82..9e516225282de4e54fa898cf8238948b51f6c664 100644 (file)
@@ -19,9 +19,9 @@ static uint32_t objid = 0;
 static struct ubus_request req_dump = { .list = LIST_HEAD_INIT(req_dump.list) };
 
 #ifdef DHCPV4_SUPPORT
-static int handle_dhcpv4_leases(struct ubus_context *ctx, _unused struct ubus_object *obj,
-               struct ubus_request_data *req, _unused const char *method,
-               _unused struct blob_attr *msg)
+static int handle_dhcpv4_leases(struct ubus_context *ctx, _o_unused struct ubus_object *obj,
+               struct ubus_request_data *req, _o_unused const char *method,
+               _o_unused struct blob_attr *msg)
 {
        struct interface *iface;
        time_t now = odhcpd_time();
@@ -90,8 +90,8 @@ static int handle_dhcpv4_leases(struct ubus_context *ctx, _unused struct ubus_ob
 }
 #endif /* DHCPV4_SUPPORT */
 
-static void dhcpv6_blobmsg_ia_addr(_unused struct dhcpv6_lease *lease, struct in6_addr *addr, int prefix,
-                                  uint32_t pref_lt, uint32_t valid_lt, _unused void *arg)
+static void dhcpv6_blobmsg_ia_addr(_o_unused struct dhcpv6_lease *lease, struct in6_addr *addr, int prefix,
+                                  uint32_t pref_lt, uint32_t valid_lt, _o_unused void *arg)
 {
        void *a = blobmsg_open_table(&b, NULL);
        char *buf = blobmsg_alloc_string_buffer(&b, "address", INET6_ADDRSTRLEN);
@@ -109,9 +109,9 @@ static void dhcpv6_blobmsg_ia_addr(_unused struct dhcpv6_lease *lease, struct in
        blobmsg_close_table(&b, a);
 }
 
-static int handle_dhcpv6_leases(_unused struct ubus_context *ctx, _unused struct ubus_object *obj,
-               _unused struct ubus_request_data *req, _unused const char *method,
-               _unused struct blob_attr *msg)
+static int handle_dhcpv6_leases(_o_unused struct ubus_context *ctx, _o_unused struct ubus_object *obj,
+               _o_unused struct ubus_request_data *req, _o_unused const char *method,
+               _o_unused struct blob_attr *msg)
 {
        struct interface *iface;
        time_t now = odhcpd_time();
@@ -177,9 +177,9 @@ static int handle_dhcpv6_leases(_unused struct ubus_context *ctx, _unused struct
        return 0;
 }
 
-static int handle_ra_pio(_unused struct ubus_context *ctx, _unused struct ubus_object *obj,
-               _unused struct ubus_request_data *req, _unused const char *method,
-               _unused struct blob_attr *msg)
+static int handle_ra_pio(_o_unused struct ubus_context *ctx, _o_unused struct ubus_object *obj,
+               _o_unused struct ubus_request_data *req, _o_unused const char *method,
+               _o_unused struct blob_attr *msg)
 {
        char ipv6_str[INET6_ADDRSTRLEN];
        time_t now = odhcpd_time();
@@ -233,8 +233,8 @@ static int handle_ra_pio(_unused struct ubus_context *ctx, _unused struct ubus_o
        return 0;
 }
 
-static int handle_add_lease_cfg(_unused struct ubus_context *ctx, _unused struct ubus_object *obj,
-                               _unused struct ubus_request_data *req, _unused const char *method,
+static int handle_add_lease_cfg(_o_unused struct ubus_context *ctx, _o_unused struct ubus_object *obj,
+                               _o_unused struct ubus_request_data *req, _o_unused const char *method,
                                struct blob_attr *msg)
 {
        if (!config_set_lease_cfg_from_blobmsg(msg))
@@ -292,7 +292,7 @@ static const struct blobmsg_policy iface_attrs[IFACE_ATTR_MAX] = {
        [IFACE_ATTR_ADDRESS] = { .name = "ipv6-address", .type = BLOBMSG_TYPE_ARRAY },
 };
 
-static void handle_dump(_unused struct ubus_request *req, _unused int type, struct blob_attr *msg)
+static void handle_dump(_o_unused struct ubus_request *req, _o_unused int type, struct blob_attr *msg)
 {
        struct blob_attr *tb[DUMP_ATTR_MAX];
        blobmsg_parse(dump_attrs, DUMP_ATTR_MAX, tb, blob_data(msg), blob_len(msg));
@@ -321,8 +321,8 @@ static void update_netifd(bool subscribe)
 }
 
 
-static int handle_update(_unused struct ubus_context *ctx, _unused struct ubus_object *obj,
-               _unused struct ubus_request_data *req, _unused const char *method,
+static int handle_update(_o_unused struct ubus_context *ctx, _o_unused struct ubus_object *obj,
+               _o_unused struct ubus_request_data *req, _o_unused const char *method,
                struct blob_attr *msg)
 {
        struct blob_attr *tb[IFACE_ATTR_MAX];
@@ -423,9 +423,9 @@ void ubus_bcast_dhcpv4_event(const char *type, const char *iface,
        ubus_notify(ubus, &main_object, type, b.head, -1);
 }
 
-static void handle_event(_unused struct ubus_context *ctx,
-                        _unused struct ubus_event_handler *ev,
-                        _unused const char *type, struct blob_attr *msg)
+static void handle_event(_o_unused struct ubus_context *ctx,
+                        _o_unused struct ubus_event_handler *ev,
+                        _o_unused const char *type, struct blob_attr *msg)
 {
        struct blob_attr *tb[OBJ_ATTR_MAX];
        blobmsg_parse(obj_attrs, OBJ_ATTR_MAX, tb, blob_data(msg), blob_len(msg));